package game;

import static org.lwjgl.opengl.GL11.*;

public class Graphics {

	private static int boxDisplayList = -1;

	public static void init() {
		boxDisplayList = glGenLists(1);
		glNewList(boxDisplayList, GL_COMPILE);
		glBegin(GL_QUADS);
		// glNormal3f(0f, 0f, 1f);
		glTexCoord2f(0f, 1f);
		glVertex3f(1f, 0f, 0f);

		glTexCoord2f(1f, 1f);
		glVertex3f(0f, 0f, 0f);

		glTexCoord2f(1f, 0f);
		glVertex3f(0f, 1f, 0f);

		glTexCoord2f(0f, 0f);
		glVertex3f(1f, 1f, 0f);

		// glNormal3f(0f, 0f, -1f);
		glTexCoord2f(0f, 1f);
		glVertex3f(0f, 0f, 1f);

		glTexCoord2f(1f, 1f);
		glVertex3f(1f, 0f, 1f);

		glTexCoord2f(1f, 0f);
		glVertex3f(1f, 1f, 1f);

		glTexCoord2f(0f, 0f);
		glVertex3f(0f, 1f, 1f);

		// glNormal3f(0f, -1f, 0f);
		glTexCoord2f(0f, 1f);
		glVertex3f(1f, 1f, 0f);

		glTexCoord2f(1f, 1f);
		glVertex3f(0f, 1f, 0f);

		glTexCoord2f(1f, 0f);
		glVertex3f(0f, 1f, 1f);

		glTexCoord2f(0f, 0f);
		glVertex3f(1f, 1f, 1f);

		// glNormal3f(0f, 1f, 0f);
		glTexCoord2f(0f, 1f);
		glVertex3f(1f, 0f, 1f);

		glTexCoord2f(1f, 1f);
		glVertex3f(0f, 0f, 1f);

		glTexCoord2f(1f, 0f);
		glVertex3f(0f, 0f, 0f);

		glTexCoord2f(0f, 0f);
		glVertex3f(1f, 0f, 0f);

		// glNormal3f(-1f, 0f, 0f);
		glTexCoord2f(0f, 1f);
		glVertex3f(1f, 0f, 1f);

		glTexCoord2f(1f, 1f);
		glVertex3f(1f, 0f, 0f);

		glTexCoord2f(1f, 0f);
		glVertex3f(1f, 1f, 0f);

		glTexCoord2f(0f, 0f);
		glVertex3f(1f, 1f, 1f);

		// glNormal3f(1f, 0f, 0f);
		glTexCoord2f(0f, 1f);
		glVertex3f(0f, 0f, 0f);

		glTexCoord2f(1f, 1f);
		glVertex3f(0f, 0f, 1f);

		glTexCoord2f(1f, 0f);
		glVertex3f(0f, 1f, 1f);

		glTexCoord2f(0f, 0f);
		glVertex3f(0f, 1f, 0f);
		glEnd();
		glEndList();
	}

	public static int getBoxDisplayList() {
		return boxDisplayList;
	}

}
